
package login.DAO;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author juan
 */
public class ConectionDAO {

    /**
     * 
     * @param usuario
     * @param contrasena
     * @param host
     * @param database
     * @return 
     * @throws SQLException 
     */
    public Connection login(String usuario, String contrasena, String host, String database) throws SQLException {

        DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
        //System.out.println("jdbc:oracle:thin:@" + host + ":1521:" + database + " .... "+ usuario + " ... "+contrasena);

        Connection connection = DriverManager.getConnection("jdbc:oracle:thin:@" + host + ":" + database, usuario, contrasena);

        return connection;
        
    }
}
